package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.DataLabels;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/DataLabelsMapper.class */
public interface DataLabelsMapper {
    @Insert({"insert into data_labels(name,to_enable) values(#{name},#{toEnable});"})
    Integer add(DataLabels dataLabels);

    @Delete({"delete from data_labels where id = #{id}"})
    Integer deleteById(Integer num);

    @Update({"<script> update  data_labels <set><if test='name != null and name.length &gt; 0'>name=#{name},</if><if test='toEnable != null '>  to_enable=#{toEnable},</if></set>where id=#{id}</script>"})
    Integer updateById(String str, Integer num, Integer num2);

    @Select({"select * from data_labels"})
    @Results({@Result(property = "toEnable", column = "to_enable")})
    List<DataLabels> selectList();

    @Select({"select * from data_labels where id = #{id}"})
    @Results({@Result(property = "toEnable", column = "to_enable")})
    DataLabels selectById(Integer num);

    @Select({"select id from data_labels where to_enable = 1"})
    Integer selectToEnable();

    @Update({" update  data_labels set to_enable = 0"})
    Integer updateToEnable();
}